<template>
  <!-- 柱节点 -->
  <div class="cylindrical-node">
    <slot name="top" />
    <div class="cylinder-top"></div>
    <div class="cylinder-body">
      <div class="node-content">
        {{ data.label }}
      </div>
    </div>
    <div class="cylinder-bottom"></div>
    <slot name="bottom" />
  </div>
</template>

<script setup lang="ts">
interface Props {
  id: string
  data: {
    label: string
    nodeType: string
  }
}

defineProps<Props>()
</script>

<style scoped>
.cylindrical-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 80px;
  min-height: 60px;
}

.cylinder-top {
  top: 0;
  position: absolute;
  width: 100%;
  height: 20px;
  background: #fff;
  border: 1px solid #000;
  border-radius:100%;
  z-index: 10;
}

.cylinder-body {
  min-width: 80px;
  height: 40px;
  background: #fff;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 5px;
  margin-top: 10px;
  z-index: 5;
}

.cylinder-bottom {
  position: absolute;
  z-index: 1;
  bottom: 0;
  width: 100%;
  height: 20px;
  background: #fff;
  border: 1px solid #000;
  /* border-top: none;
  border-left: none;
  border-right: none; */
  border-radius:100%;
}

.node-content {
  text-align: center;
  font-size: 12px;
  color: #000;
  font-weight: 500;
}
</style>
